package controllers

import (
	"github.com/astaxie/beego"
	"getsession/models"
)

type UserController struct {
	beego.Controller
}

func (this *UserController) Get()  {
      this.TplName = "login.html"
      username := this.GetString("username")
      address := this.GetString("address")
      email := this.GetString("email")

      user_name := models.User{UserName:username}
      add_ress := models.User{Address:address}
	  ema_il := models.User{Email:email}

	  if username != ""{
		  //将数据用session传出
		  session := this.StartSession()
		  session.Set("username",user_name)
		  session.Set("address",add_ress)
		  session.Set("email",ema_il)
		  this.Redirect("/getsession",302)
	  }

}
